package com.j2ee.spring.aop.privilege.annotation;

import java.lang.reflect.Method;

public class PrivilegeAnnotationParse {
	
	/**
	 * 该方法返回目标方法的权限值
	 * @param classname
	 * @param methodname
	 * @return
	 * @throws Exception
	 */
	public static String parse(Class classname, String methodname) throws Exception {
		Method method = classname.getMethod(methodname) ;
		PrivilegeInfo privilegeInfo = method.getAnnotation(PrivilegeInfo.class) ;
		return privilegeInfo.name() ;
	} 

}
